﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Wicresoft.UnifyShow.Business
{
    public interface IReportView
    {
        /// <summary>
        /// 获取用户选择的列
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>
        List<ReportViewUserSet> GetDataColumnByUserID(decimal UserID, string QueryType);

        /// <summary>
        /// 获取某种查询的所有列
        /// </summary>
        /// <param name="QueryType"></param>
        /// <returns></returns>
        List<ReportViewColumn> GetAllColumnsByQueryType(string QueryType, bool usingDefault = true);

        /// <summary>
        /// 更新我的选择
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="Columns"></param>
        void UpdateSelectedColumns(decimal UserID, string QueryType, List<ReportViewUserSet> Columns);

        /// <summary>
        /// 搜索事件列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<EventView> SearchEventList(EventQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "Incident_Number", string order = "Descending");

        DataTable SearchEventList_Report(EventQueryString query, int? pageIndex, int? pageSize, string sort = "Incident_Number", string order = "Descending");
        /// <summary>
        /// 分组统计事件列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <returns></returns>
        List<EventView> GroupEventList(decimal UserID, EventQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 获取合并工单中公司对应的二级单位
        /// </summary>
        /// <param name="company"></param>
        /// <returns></returns>
        List<string> GetDepartmentListWithCompany(string company);

        /// <summary>
        /// 合并工单搜索
        /// </summary>
        /// <param name="query"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<WorkOrderView> SearchWorkOrderList(WorkOrderQueryString query, string sort, string order);

        /// <summary>
        /// 分组统计任务列表
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<TaskView> GroupTaskList(decimal UserID, TaskQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 任务查询
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<TaskView> SearchTaskList(TaskQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "JobNo", string order = "Descending");

        DataTable SearchTaskList_Report(TaskQueryString query, int? pageIndex, int? pageSize, string sort = "JobNo", string order = "Descending");

        /// <summary>
        /// 获取事件性质
        /// </summary>
        /// <returns></returns>
        List<string> GetEventProperties();

        /// <summary>
        /// 依据事件性质得到事件分类
        /// </summary>
        /// <param name="eventPorperty"></param>
        /// <returns></returns>
        List<string> GetEventType1AccordingEventProperty(string eventPorperty);

        /// <summary>
        /// 分组变更统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<ChangeView> GroupChangeList(decimal UserID, ChangeQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 变更搜索
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<ChangeView> SearchChangeList(ChangeQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "Infrastructure_Change_ID", string order = "Descending");

        DataTable SearchChangeList_Report(ChangeQueryString query, int? pageIndex, int? pageSize, string sort = "Infrastructure_Change_ID", string order = "Descending");

        /// <summary>
        /// 硬件资产分组统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<HardwareView> GroupHardwareList(decimal UserID, HardwareQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 硬件搜索
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<HardwareView> SearchHardwareList(HardwareQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        DataTable SearchHardwareList_Report(HardwareQueryString query, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        /// <summary>
        /// 软件资产分组统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<SoftwareView> GroupSoftwareList(decimal UserID, SoftwareQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 软件搜索
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<SoftwareView> SearchSoftwareList(SoftwareQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        DataTable SearchSoftwareList_Report(SoftwareQueryString query, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        /// <summary>
        /// 应用系统资产分组统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<BusinessSystemView> GroupBusinessSystemList(decimal UserID, BusinessSystemQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 应用系统搜索
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<BusinessSystemView> SearchBusinessSystemList(BusinessSystemQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        DataTable SearchBusinessSystemList_Report(BusinessSystemQueryString query, int? pageIndex, int? pageSize, string sort = "Name", string order = "Descending");

        /// <summary>
        /// 告警分组统计
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="groupName"></param>
        /// <param name="groupCode"></param>
        /// <returns></returns>
        List<AlertView> GroupAlertList(decimal UserID, AlertQueryString query, out string groupName, out string groupCode);

        /// <summary>
        /// 告警搜索
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="query"></param>
        /// <param name="totalCount"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="sort"></param>
        /// <param name="order"></param>
        /// <returns></returns>
        List<AlertView> SearchAlertList(AlertQueryString query, out decimal totalCount, int? pageIndex, int? pageSize, string sort = "CreateTime", string order = "Descending");

        DataTable SearchAlertList_Export(AlertQueryString query, int? pageIndex, int? pageSize, string sort = "CreateTime", string order = "Descending");
    }
}
